]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Make sure that the network menu is insensitive when in the lock screen
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 12 Jun 2013 07:37:50 +0000 (03:37 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 28 Jul 2013 19:40:24 +0000 (15:40 -0400)
Since the network section of the aggregate menu will be shown in the lock
screen, we need to ensure that users can't tweak with network settings or
anything like that.

https://bugzilla.gnome.org/show_bug.cgi?id=704670

js/ui/status/network.js

index 1da477a3e213239a406a82b4f25be040a6ac6c43..840c7582349549eea75e11d9fab37c02778d0dd6 100644 (file)
@@ -713,6 +713,14 @@ const NMApplet = new Lang.Class({
         this._client.connect('device-added', Lang.bind(this, this._deviceAdded));
         this._client.connect('device-removed', Lang.bind(this, this._deviceRemoved));
         this._settings.connect('new-connection', Lang.bind(this, this._newConnection));
+
+        Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+        this._sessionUpdated();
+    },
+
+    _sessionUpdated: function() {
+        let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
+        this._section.setSensitive(sensitive);
     },
 
     _ensureSource: function() {